import {defineConfig} from 'vite'
import vue from '@vitejs/plugin-vue'
import svgLoader from 'vite-svg-loader'
import {resolve} from 'path'
// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue(), svgLoader({svgo:false})],
  server:{
    open:true
  },
  build: {
    terserOptions: {
      compress: {
        drop_console: true,
        drop_debugger: true,
      }
    }
  },
  resolve: {
    alias: {
      '@': resolve('src'),
      '~': resolve('src/views')
    }
  },
  define: {
    'process.env.VUE_APP_TITLE': `${process.env.VUE_APP_TITLE}`,
    'process.env.PORT': `${process.env.PORT}`,
  },
  css: {
    preprocessorOptions: {
      less: {
        modifyVars: {
          'vab_color_blue': '#1890ff',
          'vab_margin': '20px',
          'vab_padding': '20px',
          'vab_header_height': '65px',
        }
      }
    }
  }
})
